<?php
			
	/* SVN FILE: $Id: index.php 12 2011-03-14 13:34:57Z michele.andreoletti@gmail.com $ */
	
	/**
	 * Project Name : arcadia
	 *
	 * @author $Author: michele.andreoletti@gmail.com $
	 * @version $Revision: 12 $
	 * @lastrevision $Date: 2011-03-14 13:34:57 +0000 (Mon, 14 Mar 2011) $
	 * @filesource $URL: http://arcadia.googlecode.com/svn/trunk/global/index.php $
	 */

	require_once 'include/functions.php';
	require_once 'include/const.inc.php';
	require_once '../include/auth.inc.php';
	require_once '../include/conn.inc.php';

	require_once('../include/table.php');

	$sHeadContent .= fnHeadContent($sTable);
	
	require_once('../themes/'.$sTHEME.'/template.php');
	die();
	
	function fnHeadContent($sTable) {
	
		global $sSUITE_NAME;
		global $sAPP;
		
		global $sJsVariables;
		global $sJsDocumentReady;
		global $sDrawCallback;
		global $sColumnDefs;
		global $sSorting;
		global $iDisplayLength;
		global $iDisplayStart;
		global $sAoDataPush;

		$sHeadContent = <<<EOT

		<script type="text/javascript">

		$(document).ready(function(){
			
			$sJsVariables
			
			$sJsDocumentReady			
			
			var oTable = $('#main-table').dataTable( {
				"sDom": 'rt<"dt_info"ip><"dt_length"l>',
				"oLanguage": { "sUrl": "../include/dataTables/it_IT.txt" },		
				"aoColumnDefs": [ $sColumnDefs ],
				"bAutoWidth": false,
				"aaSorting": $sSorting,
				"iDisplayLength": $iDisplayLength,
				"iDisplayStart": $iDisplayStart,
				"sPaginationType": "full_numbers",
				"bProcessing": true,
				"bServerSide": true,
				"sAjaxSource": "./json.php",
				"fnServerData": function ( sSource, aoData, fnCallback ) {
					/* Add some extra data to the sender */
					aoData.push( 	$sAoDataPush
									{ "name": "sWhat", "value": 'main-table' },
									{ "name": "sTable", "value": "$sTable" } );
					$.getJSON( sSource, aoData, function (json) { 
						/* Do whatever additional processing you want on the callback, then tell DataTables */
						fnCallback(json)
					} );
				},
				"fnDrawCallback": function() {
					
					$sDrawCallback
					
					$('.tooltip', oTable.fnGetNodes()).cluetip({
				    	showTitle: false,
				      	cluetipClass: 'jtip', 
				      	arrows: true, 
				      	dropShadow: false
					});
					
					$(".prettydate").prettyDate();

				}
			} );
		  	
		});

	</script>
EOT;

	return $sHeadContent;

	}
?>